package com.jiazaibendi.lottery.service;

import com.jiazaibendi.lottery.dao.domain.UserInfo;
import com.jiazaibendi.lottery.dao.domain.WinRecord;
import com.jiazaibendi.lottery.dao.domain.WinRecordVo;

import java.util.List;

/**
 * description
 * 纪录服务
 * @author echo_kai
 * @version 1.0
 * @date 2021/08/06
 */
public interface RecordService {

    /**
     * description
     * 纪录用户得到了一个奖品
     * @param userId
     * @param schemeId 方案id
     * @param prizeType 奖品id
     * @return void
     * @author echo_kai
     * @date 2021/8/6
     * @version 1.0
     */
    Long gainAnyPrize(long userId, long schemeId, long prizeType);

    /**
     * description
     * 查询中奖纪录，中奖滚动的数据
     * @param schemeId
     * @return java.util.List
     * @author echo_kai
     * @date 2021/8/6
     * @version 1.0
     */
    List<WinRecord> queryPrizeRecord(long schemeId);

    /**
     *description
     * 查询参与抽奖的人数
     * @param schemeId
     * @return long
     * @author echo_kai
     * @date 2021/8/6
     * @version 1.0
     */
    long queryAllJoinPeopleNumber(long schemeId);

    /**
     *description
     * 查询中奖的人数
     * @param schemeId
     * @return long
     * @author echo_kai
     * @date 2021/8/6
     * @version 1.0
     */
    long queryGainPrizePeopleNumber(long schemeId);

    /**
     *description
     * 更新获奖记录
     * @param recordId
     * @param telephone
     * @param name
     * @return void
     * @author echo_kai
     * @date 2021/8/7
     * @version 1.0
     */
    void updateWinRecord(long recordId, long telephone, String name);

    /**
     *description
     * 获取方案每小时流量
     * @param schemeId
     * @return long
     * @author echo_kai
     * @date 2021/8/7
     * @version 1.0
     */
    long queryHourFlow(long schemeId);

    /**
     *description
     * 清空方案每小时流量
     * @param schemeId
     * @return void
     * @author echo_kai
     * @date 2021/8/7
     * @version 1.0
     */
    void clearHourFlow(long schemeId);

    /**
     *description
     * 查询是否中过实物奖
     * @param schemeId
     * @param userId
     * @param prizeId
     * @return boolean
     * @author echo_kai
     * @date 2021/8/8
     * @version 1.0
     */
    boolean queryHaveEntity(long schemeId, long userId, long prizeId);

    /**
     *description
     * 查询一天内是否中过红包
     * @param schemeId
     * @param userId
     * @param prizeId
     * @return boolean
     * @author echo_kai
     * @date 2021/8/8
     * @version 1.0
     */
    boolean queryHaveEnvelope(long schemeId, long userId, long prizeId);

    /**
     *description
     * 查询是否中过购房券
     * @param schemeId
     * @param userId
     * @param prizeId
     * @return boolean
     * @author echo_kai
     * @date 2021/8/8
     * @version 1.0
     */
    boolean queryHaveCoupon(long schemeId, long userId, long prizeId);

    /**
     *description
     * 查询我的奖品
     * @param schemeId
     * @param userId
     * @return java.util.List<com.jiazaibendi.lottery.dao.domain.WinRecord>
     * @author echo_kai
     * @date 2021/8/8
     * @version 1.0
     */
    List<WinRecordVo> queryMyPrizes(long schemeId, long userId);

    /**
     *description
     * 根据手机号查询userID
     * @param telephone
     * @return long
     * @author echo_kai
     * @date 2021/8/8
     * @version 1.0
     */
    long getUserIdByTelephone(long telephone);

    UserInfo getUserByOpenId(String openid);

    void insertUser(UserInfo userInfo);

    void clearAllJoinPeopleNumber(long schemeId);

    void addAllJoinPeopleNumber(long schemeId);
}
